export function getUserInfo(){
	let userInfo =  uni.getStorageSync("UserInfo") ?? {};
	 if(!userInfo) userInfo = {};
	 return userInfo;
	
}

export function setUserNickName(nickname){
  let userInfo = getUserInfo() ?? {};
   if(!userInfo) userInfo = {};
  userInfo.nickname = nickname;
  uni.setStorageSync("UserInfo",userInfo);
   return userInfo;
}


export function setUserAvatar(avatar){
  let userInfo = getUserInfo() ?? {};
  if(!userInfo) userInfo = {};
  console.log("userInfo:"+userInfo);
  userInfo.avatar = avatar;
  uni.setStorageSync("UserInfo",userInfo);
  return userInfo;
}

export function setUserInfo(userInfo){
  uni.setStorageSync("UserInfo",userInfo);
   return userInfo;
}

